<?php $all_session = $this->session->all_userdata(); ?>
<!DOCTYPE html>
<!-- saved from url=(0056)http://startbootstrap.com/templates/simple-sidebar.html# -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">



<meta property="og:site_name" content="video system" />
<meta property="og:url" content="<?php echo base_url();?>index.php/player/cs/<?php echo @$profile[0]['vdo_id']; ?>" />
<meta property="og:title" content="<?php echo @$profile[0]['vdo_name']; ?>" /> 
<meta property="og:image" content="<?php echo base_url();?>vod_thumb/<?php echo $profile[0]['vdo_rawfile'];?>/<?php echo $profile[0]['thumb_name'];?>" /> 

<meta property="og:description" content="the video description" /> 


<title><?php echo @$profile[0]['vdo_name']; ?></title>

<?php $this->load->view('panel_head');?>
<link type="text/css" rel="stylesheet" href="<?php echo base_url();?>css/like.css">

</head>

<body>
	<script>
            $(function(){ 
                var mem_id = <?php echo $member[0]['mem_id'];  ?>; 
                var vdo_id = <?php echo $profile[0]['vdo_id']; ?>;
    
                $('.like-btn').click(function(){
                    $('.dislike-btn').removeClass('dislike-h');    
                    $(this).addClass('like-h');
                    $.ajax({
                        type:"POST",
                        url: '<?php echo base_url();?>' + "index.php/player/rate",
                        data:'act=like&mem_id='+mem_id+'&vdo_id='+vdo_id,
                        success: function(){
                        }
                    });
                });
                $('.dislike-btn').click(function(){
                    $('.like-btn').removeClass('like-h');
                    $(this).addClass('dislike-h');
                    $.ajax({
                        type:"POST",
                        url:'<?php echo base_url();?>' + "index.php/player/rate",
                        data:'act=dislike&mem_id='+mem_id+'&vdo_id='+vdo_id,
                        success: function(){
                        }
                    });
                });
                
                $('#favorite').click(function(){		
                    $.ajax({
                        type:"POST",
                        url:'<?php echo base_url();?>' + "index.php/favorite/add_favorite",
                        data:'mem_id='+mem_id+'&vdo_id='+vdo_id,
                        success: function(){
                        }
                    });
                });
				
				$('#remove_favorite').click(function(){		
                    $.ajax({
                        type:"POST",
                        url:'<?php echo base_url();?>' + "index.php/favorite/remove_favorite",
                        data:'mem_id='+mem_id+'&vdo_id='+vdo_id,
                        success: function(){
                        }
                    });
                });
            });
        </script> 

<?php $this->load->view('header');?>
<div style="height:47px;"></div>
<div class="page-content inset" >


  <div class="row">
    <div class="col-md-8">
    <div class="panel panel-default">
        <div class="panel-body">
    	<div class="embed-responsive embed-responsive-16by9">
    	<iframe class="embed-responsive-item" src="http://<?php echo $profile[0]['server_ip'];?>/stream-project/?cs=<?php echo $profile[0]['vdo_rawfile'];?>" scrolling="no" frameborder="no" marginheight="0"  marginwidth="0" width="100%" height="459em"></iframe>
        </div>

        <div>
        	<table width="100%">
            <tr>
            	<td><h4><strong><?php echo @$profile[0]['vdo_name']; ?></strong></h4></td>
                <td align="right"><?php echo @$profile[0]['vdo_view']; ?> Views</td>
            </tr>
            </table>
        	
        </div>
        
        <div>
        	<table width="100%">
            <tr>
            	<td><strong>
        <?php echo @$profile[0]['mem_name'];?>
        </strong></td>
                <td align="right">
                
                
        
      
      
               
                <div class="stat-bar">
                    <div class="bg-green" style="width:<?php echo $rate_like_percent; ?>%;"></div>
                    <div class="bg-red" style="width:<?php echo $rate_dislike_percent; ?>%;"></div>
                </div>
                
           		
            	<div class="dislike-btn <?php if(@$check_dislike[0]['dislike_rate'] == 1){ echo 'dislike-h';} ?>"><?php echo $profile[0]['vdo_dislike']; ?></div>
                <div class="like-btn <?php if(@$check_like[0]['like_rate'] == 1){ echo 'like-h';} ?>"><?php echo $profile[0]['vdo_like']; ?></div>
                
              
          
       
      

</td>
            </tr>
            </table>
        
        
       
        </div>
        
        <div>
        <?php if(@$member[0]['mem_id'] != '') { ?>
      
		<?php if($check_favorite == null) { ?>
       	 
		 <button type="button" id="favorite" data-complete-text="Added to Favourites ! " class="btn btn-primary" autocomplete="off"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Favorite</button>
		<?php } else { ?>
         <button type="button" id="remove_favorite" data-complete-text="Removed from Favourites !" class="btn btn-primary" autocomplete="off"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> Added to Favourites ! </button>
        <?php } ?>        
          
            <?php } ?>

            <button class="btn btn-default" data-toggle="modal" data-target="#report"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span></button>
            <div class="fb-share-button" data-href="<?php echo base_url();?>index.php/player/cs/<?php echo $profile[0]['vdo_id'];?>" data-layout="button_count"></div>
            <div id="fb-root"></div>
				<script>(function(d, s, id) {
                  var js, fjs = d.getElementsByTagName(s)[0];
                  if (d.getElementById(id)) return;
                  js = d.createElement(s); js.id = id;
                  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=845969515460688&version=v2.0";
                  fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));
            </script>

		<script>
          $('#favorite').on('click', function () {
            $(this).button('complete') // button text will be "finished!"
          })
		  
		  $('#remove_favorite').on('click', function () {
            $(this).button('complete') // button text will be "finished!"
          })
        </script>
       
        </div>
        
       
        
        
        
        </div>
        <!-- <div class="panel panel-default"> -->
        
        </div>
        <!-- <div class="panel-body"> -->
        
 	
     
        
        <div class="panel panel-default" style="width:100%;">
        <div class="panel-body" style="width:100%; word-wrap:break-word;">
        
       				 <?php
                        $month_arr = array(
                            '00' => "-",
                            '01' => "January",
                            '02' => "February",
                            '03' => "March",
                            '04' => "April",
                            '05' => "May",
                            '06' => "June",
                            '07' => "July",
                            '08' => "August",
                            '09' => "September",
                            '10' => "October",
                            '11' => "November",
                            '12' => "December"
                        );
                    ?>
                
                    <?php @$start = split('-',@$profile[0]['event_start']); ?>
                    <?php @$end = split('-',@$profile[0]['event_end']); ?>
  
  		<?php if(@$profile[0]['event_start'] == @$profile[0]['event_end']) { ?>
        <?php echo @$start[2].' '.@$month_arr[@$start[1]].' '.@$start[0]; ?>
        <?php } else { ?>
        <?php echo @$start[2].' '.@$month_arr[@$start[1]].' '.@$start[0]; ?> - <?php echo @$end[2].' '.@$month_arr[@$end[1]].' '.@$end[0]; ?>
        <?php } ?>
        </br></br>
      <?php echo @$profile[0]['vdo_des'];?>
    
       <?php if ($profile[0]['vdo_des'] == null) { ?>
          		<div align="center">
                - No Description -
                </div>
            <?php } ?> 
        </div>
        <!-- <div class="panel panel-default"> -->
        
        </div>
        <!-- <div class="panel-body"> -->
        
        <?php if($get_report != '') { ?>
        <?php if(@$all_session['login'][0]['mem_type'] == 2) { ?>
        <div class="panel panel-default" style="width:100%;">
        <div class="panel-body" style="width:100%;">
     
        
    	<?php foreach($get_report as $get_report) { ?>
       
        <table 	style="margin-bottom:1em;">
        	<tr>
            	<td rowspan="2" width="60em">
                    <a href="<?php echo base_url();?>index.php/pmember/profile/<?php $get_report['mem_id'];?>">
                    <?php if($get_report['mem_name'] != '') { ?>
                   		<img src="<?php echo base_url();?>uploads/<?php echo $get_report['mem_image']; ?>" width="50em"></img>
                    <?php } else { ?>
               			
                    <?php } ?>
                    </a>
                </td>
                <td>
                	<strong>
                    	<font size="2">
                        <?php if($get_report['mem_name'] != '') { ?>
                            <a href="<?php echo base_url();?>index.php/pmember/profile/<?php echo $get_report['mem_id'];?>">
                            <?php echo $get_report['mem_name'];?>
                            </a>
                        <?php } else { ?>
                        	<?php
								$this->db->where('rvdo_id' ,$get_report['rvdo_id']);
								$query = $this->db->get('report_vdo');
								$report = $query->result_array();
								
								echo $report[0]['rvdo_from'];
							?>
                        <?php } ?>
                        </font>
                    </strong>
                   	<font size="-2"><?php echo $get_report['rvdo_date'];?></font>
                </td>
            </tr>
            <tr>
            	
                <td>
                <?php echo $get_report['rvdo_ment'];?>
                </td>
            </tr>
        </table>
			
        <?php } ?>
       
      
        </div>
        <!-- <div class="panel panel-default"> -->
        
        </div>
        <!-- <div class="panel-body"> -->
        <?php } ?>
        <?php } ?>
        
    </div>
    
    
    
    <div class="col-md-4">
      <div class="panel panel-default">
        <div class="panel-body">
     

        <?php foreach($vdo as $vdo) { ?>

        
        <div class="row" style="margin-bottom:1.5em;">
          <div class="col-md-5">
            
            <div align="center"> <a href="<?php echo base_url();?>index.php/player/cs/<?php echo $vdo['vdo_id']; ?>"><img src="<?php echo base_url();?>vod_thumb/<?php echo $vdo['vdo_rawfile'];?>/<?php echo $vdo['thumb_name'];?>"/ width="100%"> </a></div>
          </div>
          <!-- <div class="col-md-2"> -->
          <div class="col-md-7" >
            <div><a href="<?php echo base_url();?>index.php/player/cs/<?php echo $vdo['vdo_id']; ?>"><?php echo $vdo['vdo_name']; ?></a></br>
              <font size="-2"><?php echo $vdo['vdo_uploadtime'];?></font></br>
              
              <!-- /pills --> 
              
            </div>
          </div>
          <!-- <div class="col-md-8"> -->
       
         
        </div>
        <?php } ?>
        
         <?php if ($vdo == null) { ?>
         <div align="center">
         - No Vdo -
         </div>
         <?php } ?>
        
        
        
        </div>
        <!-- <div class="panel panel-default"> -->
        
        </div>
        <!-- <div class="panel-body"> -->
    
    </div>
    <!-- col-md-4 -->
  </div>
  <!-- div row -->
  

</div>
<!-- <div class="page-content inset"> --> 


<!-- Report -->
<?php echo form_open('preport/report'); ?>
<div class="modal fade " id="report" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Help Us Understand the Problem</h4>
      </div>
      <div class="modal-body">
        <table width="100%">
         <tr>
          		<td>
                 <?php if(@$member[0]['mem_id'] == '') { ?>
                 	Your e-mail : <input type="email" name="email" placeholder="stream@mail.com" required/>
                 <?php } ?>
                </td>
          </tr>
          <tr>
            <td  height="35em" style="vertical-align:top;">Why don't you want to see this?
           
             
             <input type="hidden" name="vdo_id" value="<?php echo $this->uri->segment(3); ?>"></td>
             
          </tr>
          <tr>
              <td>
                <label>
                  <input type="radio" name="report" value="It's annoying or not interesting" id="report_0">
                  It's annoying or not interesting</label>
                <br>
                <label>
                  <input type="radio" name="report" value="I don't think it should be on Channel" id="report_1">
                  I don't think it should be on Channel</label><br>
                  <label>
                  <input type="radio" name="report" value="It's spam" id="report_1">
                  It's spam</label></br>
                  <label>
                  <input type="radio" name="report" value="other" id="report_1">
                  <input type="text" name="other" placeholder="other"/>
                  </label>
                  <br>
              </td>
          </tr>
         
          <tr>
            <td align="right" ><button type="submit" class="btn btn-danger">Submit</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">Cancle</button></td>
          <tr>
        </table>
      </div>
    </div>
  </div>
</div>
<!-- Report--> 
<?php echo form_close();?>




<!-- Custom JavaScript for the Menu Toggle --> 
<script>
    $("#menu-toggle").click(function(e) {
        e.preventDefault();
        $("#wrapper").toggleClass("active");
    });
</script> 

<!-- checkbox --> 
<script>
$('#select-all').click(function(event) {   
    if(this.checked) {
        // Iterate each checkbox
        $(':checkbox').each(function() {
            this.checked = true;                        
        });
    }else{
		$(':checkbox').each(function() {
			this.checked = false;
		});
	}
});
</script>


</body>
</html>
